package com.example.medicalequipment.database;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.medicalequipment.entity.User;

@Dao
public interface UserDao {

    @Insert
    long insertUser(User user);

    @Query("SELECT * FROM users WHERE username = :username AND password = :password")
    User login(String username, String password);

    @Query("SELECT * FROM users WHERE username = :username")
    User getUserByUsername(String username);

    @Query("SELECT * FROM users WHERE id = :id")
    User getUserById(int id);
}
